#pragma once

#include <memory>



#define BIT(x) (1 << x)


#ifdef ORANGE_ENABLE_ASSERT
	#define ORANGE_ASSERT(x,...){ if(!(x)){ ORANGE_ERROR("Assertion Failed {0}",__VA_ARGS__); __debugbreak(); } }
	#define ORANGE_CORE_ASSERT(x,...){ if(!(x)){ ORANGE_CORE_ERROR("Assertion Failed {0}",__VA_ARGS__); __debugbreak(); } }
#else
	#define ORANGE_ASSERT(x,...)
	#define ORANGE_CORE_ASSERT(x,...)
#endif // ORANGE_ENABLE_ASSETS


#define ORANGE_BIND_FN(x) std::bind(&x, this, std::placeholders::_1)


namespace Orange {
	template <typename T>
	using Scope = std::unique_ptr<T>;

	template <typename T , typename ... Args>
	constexpr Scope<T> CreateScope(Args&& ... args) {
		return std::make_unique<T>(std::forward<Args>(args)...);
	}

	template <typename T>
	using Ref = std::shared_ptr<T>;
	template <typename T, typename ... Args>
	constexpr Ref<T> CreateRef(Args&& ... args) {
		return std::make_shared<T>(std::forward<Args>(args)...);
	}


}